Update VA
Path
- URL:
/cb-core/api/v1/va/update - Method:
POST - Description: This API allows updating a virtual account in the system.
Request
Request Table
| Params | Data Type + Length | Required | Description |
|---|---|---|---|
| request_id | string(50) | Yes | Unique request ID, suggested format: MerchantCode+YYYYMMDDHHMMSS+UniqueId |
| request_time | string(19) | Yes | Request time in format: YYYY-MM-DD HH:MM:SS |
| merchant_code | string(20) | Yes | If the Seller is under your sub-merchant, fill your sub merchant code provided by Baokim. If Seller is under you, fill your Merchant_code provided by Baokim as above |
| seller_id | string(50) | No | Seller ID matching the Onboarding Sellers API (optional if you want to update Seller) |
| mid | string(50) | No | On-platform MID of the Seller (optional, only for On-platform merchants) |
| reference_code | string(100) | Yes | The reference code of VA managed in your system |
| acc_name | string(63) | No | Updated name of the Virtual Account holder |
| status | int(1) | No | Fill 2. if you want to deactivate the VA. After deactivation, the VA can not be updated |
| type | int(1) | No | 1: Collect the correct amount, 2: Collect the free amount |
| amount | string(25) | No | type = 1 => The amount you want to collect |
| number_of_times_collect | string(25) | No | -1: unlimited, >= 1 number of times, If you don't want to collect anymore, update status = 2 |
| expire_date | string(19) | No | Format: YYYY-MM-DD HH:MM:SS |
| memo | string(255) | No | Updated transfer note or description for the Virtual Account |
| va_purpose | int(1) | No | Purpose of the Virtual Account 1: Ecom Shopee Vietnam 2: Ecom Lazada Vietnam 3: Ecom Tiktokshop Vietnam 4: B2B 5: Website 6: Other 7: All |
Request Example
{
"request_id": "MERCHANT12345678901234510130",
"request_time": "2024-11-15 14:41:00",
"merchant_code": "PHUONGTT",
"seller_id": "SELLER12345",
"mid": "MID12345",
"reference_code": "REF1231081",
"acc_name": "Nguyen Van D",
"type": 1,
"status": 2,
"amount": "20000",
"number_of_times_collect": "2",
"expire_date": "2024-11-20 12:00:00",
"memo": "Payment for order 12345",
"va_purpose": 1
}
Response
Response Table
| Params | Data Type + Length | Required | Description |
|---|---|---|---|
| response_code | int(4) | Yes | Error code from Baokim as per Error Codes Table |
| response_message | string(100) | Yes | Description of the error code from Baokim as per Error Codes Table |
| merchant_code | string(20) | Yes | Merchant code provided by Baokim before integration |
| reference_code | string(100) | Yes | The reference code of VA managed in your system |
| status | int(1) | Yes | 1: Active, 2: Inactive |
| expire_date | string(19) | Yes | Format: YYYY-MM-DD HH:MM:SS |
| account_info | object | Yes | Virtual account details |
| account_info.bank_name | string(100) | Yes | Bank name |
| account_info.bank_no | string(6) | Yes | Bank no |
| account_info.bank_branch | string(100) | Yes | Bank branch |
| account_info.acc_no | string(22) | Yes | Bank account number |
| account_info.acc_name | string(63) | Yes | Account holder's name |
| account_info.qr | string(100) | Yes | QR string encoded with base64 |
| account_info.qr_path | string(100) | Yes | QR image path |
Response Example
{
"response_code": 200,
"response_message": "Success",
"merchant_code": "PHUONGTT",
"reference_code": "REF1231081",
"status": 1,
"expire_date": "2024-11-20 12:00:00",
"account_info": {
"bank_name": "Ngân hàng Thương mại Cổ phần Đầu tư và Phát triển Việt Nam",
"bank_no": "970418",
"bank_branch": "Hà Nội",
"acc_no": "963336011173760",
"acc_name": "NGUYEN VAN D",
"qr": "00020101021238590010A0000007270129000697041801159633360111737600208QRIBFTTA53037045405200005802VN63049068",
"qr_path": "https://devtest.baokim.vn/vietqr/core/view/BKREF123108120241115144204.jpg"
}
}
Error Code
| Response Code | Response Message |
|---|---|
| 200 | Success |
| 99 | Pending |
| 11 | Failed |
| 101 | System Error |
| 110 | Merchant Code Invalid |
| 120 | Invalid Signature |
| 422 | Validation Error |
| 2101 | No VA found with this reference_code |